package cn.longwi.lwse.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class RespResult {

    private int code;

    private String msg;

    private Object data;

    public static RespResult success(Object data) {
        return new RespResult(ResponseCode.SUCCESS.getCode(), ResponseCode.SUCCESS.getMsg(), data);
    }

    public static RespResult error(ResponseCode responseCode,Object data) {
        return new RespResult(responseCode.getCode(), responseCode.getMsg(), data);
    }
}
